/**
 * Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.invoice.customer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jeeplus.invoice.customer.service.dto.YxfpCustomerDTO;
import com.jeeplus.invoice.customer.domain.YxfpCustomer;
import org.apache.ibatis.annotations.Select;

/**
 * 客户管理MAPPER接口
 * @author 张如利
 * @version 2022-01-20
 */
public interface YxfpCustomerMapper extends BaseMapper<YxfpCustomer> {

    /**
     * 根据id获取客户管理
     * @param id
     * @return
     */
    YxfpCustomerDTO findById(String id);

    /**
     * 获取客户管理列表
     *
     * @param queryWrapper
     * @return
     */
    IPage <YxfpCustomerDTO> findList(Page <YxfpCustomerDTO> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);

    /**
     * 根据openId获取客户管理
     * @param openId
     * @return
     */
    @Select("SELECT * FROM yxfp_customer WHERE open_id = #{0}")
    YxfpCustomerDTO findByOpenId(String openId);
}
